package com.qd.common.panda.domain.entity.record;

import com.cdqidi.valid.group.DefaultGroup;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.util.List;

/**
 * 添加开票记录，主要操作人为手机端用户
 *
 * @author sjk
 */
@Data
@Accessors(chain = true)
public class UserBillRecordVO {
    /**
     * 发票抬头
     */
    @Size(max = 100, message = "发票抬头长度不能超过{max}位", groups = DefaultGroup.class)
    private String title;
    /**
     * 税号
     */
    @Size(max = 50, message = "税号长度不能超过{max}位", groups = DefaultGroup.class)
    private String dutyParagraph;
    /**
     * 发票内容
     */
    @Size(max = 200, message = "发票内容长度不能超过{max}位", groups = DefaultGroup.class)
    private String note;
    /**
     * 发票金额
     */
    private BigDecimal amount;
    /**
     * 更多信息
     */
    @Size(max = 200, message = "更多信息长度不能超过{max}位", groups = DefaultGroup.class)
    private String moreMsg;
    /**
     * 收件人
     */
    @NotBlank(message = "收件人不能为空", groups = DefaultGroup.class)
    @Size(max = 100, message = "收件人长度不能超过{max}位", groups = DefaultGroup.class)
    private String userName;
    /**
     * 手机号码
     */
    @NotBlank(message = "手机号码不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "手机号码长度不能超过{max}位", groups = DefaultGroup.class)
    private String mobile;
    /**
     * 邮箱地址
     */
    @Size(max = 50, message = "邮箱地址长度不能超过{max}位", groups = DefaultGroup.class)
    private String email;
    /**
     * 抬头类型
     */
    @NotBlank(message = "抬头类型不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "抬头类型长度不能超过{max}位", groups = DefaultGroup.class)
    private String typeHeader;

    @Valid
    @NotNull(message = "行程ID集合不能为空")
    private List<String> strokeIds;

    public void freeData() {
        this.title = null;
        this.dutyParagraph = null;
        this.note = null;
        this.amount = null;
        this.moreMsg = null;
        this.userName = null;
        this.mobile = null;
        this.email = null;
        this.typeHeader = null;
    }
}
